<%@page import="com.blockchain.front.servlets.SendEmailCode"%>
<%@page import="com.blockchain.front.servlets.TxYzmExists"%>
<%@page import="com.blockchain.front.servlets.RegisterVerify"%>
<%if(blockchainSession!=null&&blockchainSession.isAuthenticated()){ controller.forwardController(request, response, Index.class);return;} %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.common.enums.TermType"%>
<%@page import="com.blockchain.front.servlets.Term"%>
<%@page import="com.blockchain.front.servlets.Send"%>
<%@page import="com.blockchain.front.servlets.CheckNameExists"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<html>
<head>
<%
String str = languageDefine.getValue(request, "register_register");
String _TITLE_ = str+" - "+configureProvider.getProperty(SystemVariable.SITE_NAME);
String _DESCRIPTION_ = "综合数字货币交易平台，拥有专业的团队、先进的技术和资深的行业经验，致力于成为中国最稳定、最安全、最专业、最全面的数字货币、数字资产、虚拟货币综合交易平台。";
String vcode = null;
String lang = null;

String errorMsg = controller.getPrompt(request,response,PromptLevel.ERROR);
if (request.getParameter("vcode") != null && request.getParameter("vcode").startsWith("btb")) {
	vcode = request.getParameter("vcode").replaceAll("btb", "");
	lang = request.getParameter("lang");
}
%>
<title><%=_TITLE_ %></title>
<%@include file="/WEB-INF/include/meta.jsp"%>
<meta name="description" content="<%=_DESCRIPTION_ %>">
<%@include file="/WEB-INF/include/style.jsp"%>
</head>
<body >
	<%!public static String getCookieByName(HttpServletRequest request,String name){
	    Map<String,Cookie> cookieMap = ReadCookieMap(request);
	    if(cookieMap.containsKey(name)){
	        Cookie cookie = (Cookie)cookieMap.get(name);
	        return cookie.getValue();
	    }else{
	        return null;
	    }   
	}%>
	
	<%!private static Map<String,Cookie> ReadCookieMap(HttpServletRequest request){  
	    Map<String,Cookie> cookieMap = new HashMap<String,Cookie>();
	    Cookie[] cookies = request.getCookies();
	    if(null!=cookies){
	        for(Cookie cookie : cookies){
	            cookieMap.put(cookie.getName(), cookie);
	        }
	    }
	    return cookieMap;
	}%>
	<%!public static void addCookie(HttpServletResponse response,String name,String value,int maxAge){
	    Cookie cookie = new Cookie(name,value);
	    cookie.setPath("/");
	    if(maxAge>0)  cookie.setMaxAge(maxAge);
	    response.addCookie(cookie);
	}%>
<body>
<%@include file="/WEB-INF/include/header.jsp"%>
<div class="autobox" id="reg-step1">
    <div class="login_step">
        <ul class="order clear">
            <li class="orange"><i class="order_1_1"></i><%=languageDefine.getValue(request, "register_userRegister")%>
                <div class="order_line"></div></li>
            <li><i class="order_2"></i><%=languageDefine.getValue(request, "register_setTradePassword")%>
                <div class="order_line"></div></li>
            <li><i class="order_3"></i><%=languageDefine.getValue(request, "register_verified")%>
                <div class="order_line"></div></li>
            <li><i class="order_4"></i><%=languageDefine.getValue(request, "register_success")%></li>
        </ul>
    </div>
    <%String errorMessage = controller.getPrompt(request,response,PromptLevel.ERROR);%>
    <form action="<%=controller.getURI(request, Register.class)%>" method="post" onsubmit="return onSubmit()">
    <div class="reg_box">
        <div>
            <div id="reg-control" class="btn-group" style="text-align: center; margin: 30px 0 10px 370px;"></div>
            <div class="com_warning"  style="padding-left: 460px;"><%StringHelper.filterHTML(out, null==errorMessage?"":(errorMessage.indexOf("err_")!=-1?languageDefine.getValue(request, errorMessage):errorMessage));%></div>
            <div id="reg_index" class="reg_wrap">
                <div class="reg_input_box reg-fb" id="username_reg">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_email")%>：</div>
                    <input type="text" id="moble" value="<%StringHelper.filterHTML(out,request.getParameter("phone"));%>" name="phone" onblur="phoneCheck();" />
                    <div id="moble-msg" class="form_explain" data-explain='<%=languageDefine.getValue(request, "register_enterPhoneNumber")%><em></em>' style="display: none;">
                        	<%=languageDefine.getValue(request, "register_enterPhoneNumber")%><em></em>
                    </div>
                </div>
                <div class="reg_input_box reg-fb" id="reg_first_verify">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_captcha")%>：</div>
                    <input type="text" onblur="txverifyCheck();"  name="txverifyCode" id="verify" maxlength="4" style="width: 165px; box-shadow: none; " />
                    <div id="verify-msg" class="form_explain" data-explain='<%=languageDefine.getValue(request, "register_enterCaptcha")%><em></em>' style="display: none;">
                        	<%=languageDefine.getValue(request, "register_enterCaptcha")%><em></em>
                    </div>
                    <img class="codeImg" id="_verifyImg" src="<%=controller.getURI(request, RegisterVerify.class)%>" title="<%=languageDefine.getValue(request, "register_changeCaptcha")%>" onclick="this.src='<%=controller.getURI(request, RegisterVerify.class)%>?'+Math.random()" >
                </div>
                <div class="reg_input_box reg-fb" id="reg_first_verify">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_getCaptcha")%>：</div>
                    <input id="regBtn" type="button" class="pocoins_btn" value='<%=languageDefine.getValue(request, "register_freeGetCaptcha")%>' onclick="sendCode(this);" style="width: 160px;height: 40px;" maxlength="4">
                </div>
                <div class="reg_input_box reg-fb" id="reg_first_verify">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_smsVerificationCode")%>：</div>
                    <input type="text" id="moble_verify" name="dxverifyCode" onblur="dxverifyCheck();"/>
                </div>
                <div class="reg_input_box reg-fb">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_loginPassword")%>：</div>
                    <input type="password" id="password" name="password"   onblur="passwordCheck()" maxlength="16" value="<%StringHelper.filterHTML(out,request.getParameter("password"));%>"/>
                    <div id="password-msg" class="form_explain" data-explain='<%=languageDefine.getValue(request, "register_passwordReg")%><em></em>' style="display: none;">
                        <%=languageDefine.getValue(request, "register_passwordReg")%><em></em>
                    </div>
                </div>
                <div class="reg_input_box reg-fb">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_repeatPassword")%>：</div>
                    <input type="password" id="repassword" name="newPassword" onblur="rePasswordCheck()"  value="<%StringHelper.filterHTML(out,request.getParameter("newPassword"));%>"/>
                    <div id="repassword-msg" class="form_explain" data-explain='<%=languageDefine.getValue(request, "register_needConsistent")%><em></em>' style="display: none;">
                        	<%=languageDefine.getValue(request, "register_needConsistent")%><em></em>
                    </div>
                </div>
                <div class="reg_input_box reg-fb">
                    <div class="reg_title"><%=languageDefine.getValue(request, "register_invitationCode")%>：</div>
                    <input id="code"  type="text"  placeholder='<%=languageDefine.getValue(request, "register_notRequired")%>' name="code"  maxlength="6" onblur="codeCheck();" <%if(vcode != null){%>value="<%=vcode %>" readonly = "readonly"<%} %>>
                	<div id="code-msg" class="form_explain" style="display: none;"><%=languageDefine.getValue(request, "register_invitationCodeReg")%><em></em>
                 </div>
                </div>
                <div class="reg_radio_box">
                    <label><%=languageDefine.getValue(request, "register_asAgreed")%> <a href="javascript:void(0)" onclick="registerAgreement();"><%=languageDefine.getValue(request, "register_protocol")%></a></label>
                </div>
                <div class="formbody">
                     <input type="submit" class="pocoins_btn"  value='<%=languageDefine.getValue(request, "register_registerNow")%>' title='<%=languageDefine.getValue(request, "register_registerNow")%>' style="width: 320px;">
                   </div>
            </div>
        </div>
    </div>
    </form>
</div>
<%@include file="/WEB-INF/include/footer.jsp"%>
<%@include file="/WEB-INF/include/script.jsp"%>
<script type="text/javascript">
var _nURL='<%=controller.getURI(request, CheckNameExists.class)%>';
var _cUrl = '<%=controller.getURI(request, SendEmailCode.class)%>';
var xy_url = '<%=controller.getPagingItemURI(request, Term.class, TermType.YHXY.name())%>';
var _tx_url='<%=controller.getURI(request, TxYzmExists.class)%>';
</script>
<script type="text/javascript" src="<%=controller.getStaticPath(request)%>/js/register.js"></script>
</body>
</html>	
	
